package com.water.wfo.component.log;

import ch.qos.logback.core.ConsoleAppender;
import com.water.wfo.component.constant.Constants;
import com.water.wfo.component.constant.SystemConstants;


/**
 * packageName com.water.wfo.component.log
 *
 * @author junhuili
 * @version JDK 8
 * @date 2024/5/28
 * @description TODO
 */
public class WfoConsoleAppender<E> extends ConsoleAppender {
    private static String logConsole;
    @Override
    public void start(){
        super.start();
    }
    @Override
    protected void append(Object eventObject){
        if(Constants.SUCCESS_STRING.equals(logConsole())){
            super.append(eventObject);
        }
    }

    private static final String logConsole(){
        if(null == logConsole){
            logConsole = System.getProperty(SystemConstants.APPLICATION_LOG_CONSOLE);
        }
        return logConsole;
    }
}
